<template>
	<!-- <el-select v-model="value" filterable placeholder="请选择门店" clearable :multiple="multiple">
		<el-option v-for="item in options" :key="item.value" :label="item.name" :value="item.id" />
	</el-select> -->
	<sc-table-select v-model="value" :apiObj="apiObj" :params="params" :table-width="600" :props="prop" @change="change"
		:multiple="multiple" clearable collapse-tags ref="select" :placeholder="placeholder">
		<template #header="{form, submit}">
			<el-form :inline="true" :model="form">
				<el-form-item>
					<el-input v-model="form.keyword" placeholder="用户名称"></el-input>
				</el-form-item>
				<el-form-item>
					<el-button type="primary" @click="submit">查询</el-button>
				</el-form-item>
			</el-form>
			<!-- <span @click="onClose">关闭</span> -->
		</template>
		<el-table-column prop="name" label="用户名称"></el-table-column>
	</sc-table-select>
</template>

<script>
	export default {
		name: 'storeSelect2',
		props: ['multiple','defaultValue','placeholder'],
		data() {
			return {
				value: '',
				params: {
					name: null,
				},
				prop: {
					label: 'name',
					value: 'id',
					keyword: "keyword"
				},
				apiObj: this.$API.system.user.list,
			}
		},
		watch: {
			defaultValue(){
				this.value = this.defaultValue
			},
			value() {
				this.$emit('update:modelValue', this.value)
			}
		},
		created() {
			//this.getStore()

		},
		methods: {
			onClose(){
				this.$refs.select.blur()
			},
			//值变化
			change(val) {
				//this.$message('change事件，返回详情查看控制台')
				console.log(val)
			},
		}
	}
</script>

<style>
</style>
